package com.zhuojy.equity.mall.admin.web.controller.car;


import com.zhuojy.equity.mall.admin.common.entity.po.car.TCarIllegalPO;
import com.zhuojy.equity.mall.admin.common.pojo.ResultEntity;
import com.zhuojy.equity.mall.admin.service.car.TCarIllegalService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author xrz
 * @version 1.0
 * @description:TODO
 * @date 2024/4/8 19:50
 */
@RestController
@RequiredArgsConstructor
@CrossOrigin
@RequestMapping("carillegal")
public class TCarIllegalController {
    @Autowired
    private TCarIllegalService tCarIllegalService;

    /**
     * 分页查询违章记录
     * @param tCarMaintainPO
     * @param pageSize
     * @param pageNum
     * @return
     */
    @RequestMapping("findCarcheerPagination")
    private ResultEntity findCarcheerPagination(@RequestBody TCarIllegalPO tCarMaintainPO, @RequestParam("pageSize") Integer pageSize, @RequestParam("pageNum") Integer pageNum){
        return tCarIllegalService.findCarcheerPagination(tCarMaintainPO,pageSize,pageNum);
    }

    /**
     * 通过id删除对应的信息
     * @param id
     * @return
     */
    @RequestMapping("delillegal")
    private ResultEntity delMaintain(@RequestParam("id")Integer id){
        return tCarIllegalService.delMaintain(id);
    }

    /**
     * 添加违章记录
     * @param tCarMaintainPO
     * @return
     */
    @RequestMapping("addillegal")
    private ResultEntity addMaintain(@RequestBody TCarIllegalPO tCarMaintainPO){
        return tCarIllegalService.addMaintain(tCarMaintainPO);
    }

    /**
     * 通过id回显对应的信息
     * @param id
     * @return
     */
    @RequestMapping("echoillegal")
    private ResultEntity echoMaintain(@RequestParam("id") Integer id){
        return tCarIllegalService.echoMaintain(id);
    }

    /**
     * 修改对应的信息
     * @param tCarMaintainPO
     * @return
     */
    @RequestMapping("upillegal")
    private ResultEntity upMaintain(@RequestBody TCarIllegalPO tCarMaintainPO){
        return tCarIllegalService.upMaintain(tCarMaintainPO);
    }
}
